package com.dongzili.demo.customer.sync;

import com.dongzili.demo.common.config.es.EsUtils;
import com.dongzili.demo.common.vo.ApiResponse;
//import com.dongzili.demo.customer.es.mapper.RelationMapper;
import com.dongzili.demo.customer.model.Relation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sync")
public class SyncController {

//    @Resource
//    RelationMapper relationMapper;

    @GetMapping("/relation")
    public ApiResponse<?> doSync() {
//        SyncService.getInstance(Relation.class).syncIndex(relationMapper);
        SyncService.getInstance(Relation.class).syncIndex(EsUtils.getMapper(Relation.class));

        return ApiResponse.success();
    }
}
